#!/bin/bash
mkdir cubit
files=`find . -name "*.mstk"`
echo $files
for file in $files
do 
echo $file
filename=${file:2}
dir=`dirname $filename`
if [ ! -d $dir/passed ]; then
mkdir $dir/passed
fi
meshname=`basename $file .mstk`
~/duo-mstk/converter/mstk2exo-cubit $file 
result=$?
if [ $result -eq 1 ]; then
mv $file cubit
fi
done